//
//  LefuProductPlugin+Init.swift
//  Runner
//
//  Created by LanjingMini on 2025/3/13.
//

import Foundation
import PPBluetoothKit


extension LfProductPlugin {
    /// 初始化SDK
        /// - Parameters:
        ///   - arguments: <#arguments description#>
        ///   - result: <#result description#>
        public func initSDK(_ arguments: Any?) {
            debugPrint("Lefu SDK:初始化2")
            guard let args = arguments as? [String], args.count == 2 else {
                print(arguments as? [String])
                return
            }
            // 获取参数
            let appkey = args[0]
            let appSecrect = args[1]
            let path = Bundle.main.path(forResource: "lefu", ofType: "config") ?? ""
            debugPrint("--- path ---")
            print(appkey)
            print(appSecrect)
            print(path)
            debugPrint("--- path ---")
            let aaa = PPBluetoothManager.loadDevice(withAppKey: appkey, appSecrect: appSecrect, filePath: path)
            print(aaa)
        }
}
